export default {
  //服务类型列表
  loadServeListServer(params, callback) {
    Vue.http.get('/toHome/list.json', { params: params }).then(function(response) {
      callback(response.data);
    });
  },
  //服务详情
  loadServeDetailServer(params, callback) {
    Vue.http.get('/toHome/detail.json', { params: params }).then(function(response) {
      callback(response.data);
    });
  },
  // 新增服务
  addServeServer(params, callback_success, callback_error) {
    Vue.http.post('/toHome/add.json', params).then(response => {
      callback_success(response.data);
    }, response => {
      callback_error(response.data)
    });
  },
  // 修改服务
  editServeServer(params, callback_success, callback_error) {
    Vue.http.put('/toHome/modify.json', params).then(response => {
      callback_success(response.data);
    }, response => {
      callback_error(response.data)
    });
  },
  //删除服务
  deleteServeServer(params,callback) {
    Vue.http.delete('/toHome/delete.json',{params:params}).then(response=>{
      callback(response.data);
    });
  },
  //删除文件
  deleteFileServer(params,callback) {
    Vue.http.delete('/file/delete.json',{params:params}).then(response=>{
      callback(response.data);
    });
  },
}
